Petit Computer Wiki:Chat/Logs/25 September 2013
11:56 you missed some things, I guess I'll point out the line numbers when I see them 11:56 AHA I found them. 11:56 Y on line 179 11:56 First succesful rotation 11:56 Y on line 188 11:57 COLLY as well 11:57 you found another I was missing 11:57 that's why the walls didn't draw right 11:57 omg 11:57 this so so awesome 11:57 I think SLICE should be floating-point, but that's not important right now 11:57 you got it working? 11:57 somewhat! 11:58 I'll post the working code 11:58 Congratulations! 11:58 still can't walk foreward but the 3d rotation kind of works 11:59 by the way, line 110 should be J=I+Q if you don't want those weird spaces 11:59 and you can set Q=1, since speed's not really an issue 11:59 calc 11:59 http://pastebin.com/2niuQ6N0 11:59 you can directly paste this into the playbasic 11:59 and it should work with some rotation 11:59 I dont know what else i'm missing it seems off 11:59 but it renders again no more black screen 12:00 okay, next let's make DIST floating-point 12:01 kay 12:02 omg that caused the corners of walls to show up 12:02 WOO 12:08 okay calc I changed this so that Slice is a float and it messed up some of the walls so they draw entirely white. T=(T+SLICE# )*8 12:08 the walls are already messed up :P 12:08 hold on, let me paste you something with much simplified texture code 12:09 http://pastebin.com/Y7HvkXLZ 12:09 no reason not to loop now that we have speed on our side 12:11 cool 12:11 hmm, I think MOD isn't what we need in this case 12:12 since it's supposed to work with integers only 12:12 oh 12:12 I see. 12:12 also i'm trying to figure out why movements not working it renders fine now (sort of) 12:12 how did movement work in the raycaster you made? 12:14 uhh... I modify the position based on which direction you're facing 12:14 oh 12:14 I see the problem 12:14 "and" is not what you should be using 12:15 ohh 12:15 that turns the assignment expressions into conditional expressions, lol 12:15 (I think) 12:15 the AND operator doesn't assign :/ 12:16 that's why sometimes it's nice to have the different = and operators, lol 12:16 SMILEBASIC would call you out on that 12:16 yeah. 12:16 The And operator performs a logical (bitwise) And on the two specified operands. 12:16 12:16 that's what the help says about AND in playbasic. I like their help files system. 12:18 ok makes sense I see now 12:19 also, I suppose the proper alternative to MOD(COLLX#,1) here is COLLX#-FLOOR(COLLX#) 12:21 http://pastebin.com/YpFCXjmM 12:21 there we go. movement sort of works? it seems finicky or buggy though. 12:22 yeah, *something* is still really weird with the rendering though 12:22 yeah. 12:23 hmm, line 163 needs a COLLY# 12:25 yeah i fixed that on mine once thanks for seeing it 12:25 ugh I dont know what else is wrong. 12:26 lol, line 159 you put an =1 instead of =0 12:26 though that doesn't seem to fix much 12:28 does VElZ have any importance 12:29 ? 12:29 oh, VELZ 12:29 that's for jumping 12:29 I changed this btw... it seems to have smoothed out some movement 12:29 IF MAP(ABS(X#),ABS(Y#)) THEN RETURN 12:29 CAMX#=X# 12:29 CAMY#=Y# 12:29 RETURN 12:30 o_o 12:30 wouldn't that be more like preventing crashes? 12:30 X# and Y# shouldn't be negative anyway 12:31 abs only returns positive integers it wont return a float 12:31 here were trying to access the array using whatever value 12:31 and playbasic wont automatically change those to absolute whole integers 12:31 on it's own i dont think 12:32 yes it will 12:32 the whole raycast routine depends on that 12:34 also, ABS doesn't have to return an integer 12:34 it does only return positive values though 12:34 (or zero) 12:35 here I found for T=0 to - 12:35 For T=0 to 0 12:35 is that meant to be something else in the loadtex 12:35 no, since there's only one texture 12:36 oh ok 12:36 I see. hmmm 12:36 hmm, you know, I almost want to start this all over again using mainly integers :P 12:36 I noticed were using box commands would there be a way to just draw the entire image offset by a value? 12:37 ah 12:37 well that'd be fun 12:37 the texture can be stored as an image 12:37 you know 12:37 can PlayBasic draw scaled images? 12:37 yeah 12:38 I have some functions for that written already to 12:38 but it's kind of 12:38 wierd. 12:38 I have a window drawing function 12:38 where you pass it if you want the image the window uses sclaed or not 12:38 scaleD* 12:38 and it renders a windowframe with border and an X button 12:38 and it will scale the image to the window size if you want as well 12:38 you could omit the border 12:38 and pass the window X and Y and window border size 12:39 but easier to do is scaleimage imagename, scalepercentX, scalepercentY, type or something 12:39 ScaleImage ImageNumber, ScaleX, ScaleY, ScaleMode 12:39 12:39 12:39 yeah, well the main idea would be to split each texture into a bunch of images 1 pixel wide 12:40 and select which image to get using SLICE 12:40 Mode 0 = (Scaler Mode) Makes ScaleImage use the SCALE X & Y parameters as multipliers of the images current width & height. (ie. NewWidth=OldWidth * ScaleX, NewHeight=OldHeight*ScaleY) 12:40 12:40 MODE 1 = (Absolute Mode) Makes ScaleImage use the SCALE X & Y parameters as the images new size. 12:40 12:40 and scale it to the correct height 12:40 now the thing is 12:40 you'd have to isolate this into a function 12:40 otherwise your source image will be scaled 12:40 and all instances of drawing it will stay the same size 12:41 hmm, that's annoying 12:41 no not really .. it's pretty simple because you could also 12:41 have a target copy and an original 12:41 then each time you use copyimage before scaling 12:41 to overwrite the last instance of the scaled image you drew 12:41 hmm, maybe DrawRotatedImage could also work 12:41 it has scale parameters 12:41 or just do it inside the function because it wont be permanent 12:42 yeah. 12:42 just use no rotation 12:43 that'd work. 12:43 brb drinkgetting time :3 12:46 Hello all 12:47 Hello? 12:48 HELLO?! 12:48 HELLOOOO 12:48 Hi 12:49 hiii 12:50 My friend says I have CAR 12:50 a long, long time ago 12:50 in a galaxy far away 12:50 I have CSD* 12:50 I wrote a variable-height raycaster in Python 12:51 The only coding I do in a real computer language is me messing with my school's website in web developer 12:51 In HTML 12:52 hey, it's still on an old flash drive! I thought it died with my old laptop 12:52 cool 12:52 oh wait. it's in a similar folder on my computer already :P 12:53 Calc do you know C or C++? 12:53 yes 12:53 Cool I gtg 12:53 i'm making tea bbiam 12:58 hey calc any luck 01:04 oh, haven't really been working 01:05 a program to emulate petit computer programs is seeming less feasible now atleast in playbasic considering how difficult it is to port a simple raycaster 01:05 :/ 01:06 I can't really see how that can be compared 01:06 I mean, an emulator would be designed to work with Petit Computer source code directly 01:07 because I don't know how to interprete some commands for instance. I can't get the petit computer raycaster to work properly so that would mean I wouldn't be able to emulate some of it's codes. Also another dilemna i've noticed. 01:07 Since Petit computer doesn't differentiate between floats and integers how would I determin what is a float and what is not. 01:08 nothing is a float 01:08 I suppose I'd have to do some testing on instances of the variable found and whether it may end up containing by chance, a floating point value. 01:08 Hm 01:08 Petit Computer uses fixed point values 01:08 Then that makes it kind of easy. 01:08 fixed point 01:08 so for example 0.4 01:08 ? 01:08 o.0 01:08 fixed point meaning the decimal point is at a constant location in the number 01:09 Petit Computer uses a format with 20 bits above and 12 bits below the decimal point 01:09 which is really more of a modified integer format than anything 01:10 basically the value 1.0 in Petit Computer is represented by 4096 01:10 and the values 1-4095 are "fractional" values 01:11 weird.. 01:11 fixed point is very good for speed, I'd say 01:11 and I'm considering we might want to do the raycaster using it 01:12 Back 01:13 Somebody should port SMB to PTC right? 01:13 *shrug* 01:13 it's already on NES VC 01:14 Yeah but it would be a cool project. 01:23 hey calc 01:23 I sort_of cleaned it up it runs a bit smoother but has some issues still 01:36 calc you know what you could do. you could try opening the WOLF3D example that comes with playbasic 01:42 I don't think that's even a raycaster 01:43 hard to tell though since the code is so cryptic :P 01:45 ahaha 01:46 the how raycasters work example you sent me doesn't compile because QuickCG.h could not be found 01:46 lol lol lol lol lol 01:46 I have VC++ 2010 01:46 I don't know about the quickcg library but it seems to be able to draw images and stuff. 01:48 this quickCG library seems useful for making games in the faster C++ language o.o and it wraps SDL. so wonderful I have to get SDL now and quickCG 01:48 :/ 01:49 although I was originally thinking of using microsoft XNA :/ omg 01:50 I wonder if I should work on a terraria style game o.0 hm 01:50 xD 02:02 I think I'm going to request for someone else to be an admin. 02:02 Calc, you want to be an admin instead of me? 02:03 Please? 02:04 wait what 02:05 Do you want to be an admin instead of me? 02:05 I can't do this... I'm just not good with confrontation 02:05 I don't know if I could handle it, haha 02:05 Ehh I'm sure you could. But if you don't want to, I understand 02:05 It's not like I'm forcing you or anything lol 2013 09 25